<template>
  <LayoutWrap :isExpand="isExpand" class="pointer-events-none flex flex-1">
    <template #left v-if="!isExpand"> <Left></Left></template>
    <template #centerTop>
      <div class="relative flex h-full w-full flex-col">
        <CenterTop
          :style="centerTopStyle"
          v-model:value="measureInfo"
          class="h-full w-full"
        ></CenterTop>
        <div class="absolute bottom-0 right-0 h-full w-full">
          <CenterBottom></CenterBottom>
        </div>
      </div>
    </template>
    <!-- <template #centerBottom><CenterBottom></CenterBottom></template> -->
    <template #right v-if="!isExpand"><Right></Right></template>
  </LayoutWrap>
</template>
<route lang="json">
{
  "name": "home",
  "meta": { "title": "数智大屏", "requireAuth": false, "layout": false }
}
</route>
<script setup lang="tsx">
import { computed, ref } from 'vue';
import LayoutWrap from './components/LayoutWrap.vue';
import CenterBottom from './components/center-bottom/index.vue';
import CenterTop from './components/home/center-top/index.vue';
import Left from './components/left/index.vue';
import Right from './components/right/index.vue';

const props = defineProps({
  isExpand: {
    type: Boolean,
    default: false,
  },
});

// 测点详情（包括监测阵id）
const measureInfo = ref<any>({});

// 根据中间图缩放样式不同
const centerTopStyle = computed(() => {
  return {
    margin: !props.isExpand ? '0 18px' : '0',
    width: !props.isExpand ? 'calc(100% - 36px)' : '100%',
    height: '100%',
  };
});
</script>
